package Com.aop.pojo;

import Com.aop.dao.DBUtils;
import org.springframework.stereotype.Component;

import java.sql.SQLException;
@Component
public class BankDaoImpl {
    public  int  jian_money(String name,int money) throws SQLException {
        String sql="UPDATE `myschool`.`bank` SET `currentMoney` =`currentMoney`- ? WHERE `customerName` = ?";
       return DBUtils.ExecuteUpdate(sql,new Object[]{money,name});
    }
    public  int  jia_money(String name,int money) throws SQLException {
        String sql="UPDATE `myschool`.`bank` SET `currentMoney` =`currentMoney`+ ? WHERE `customerName` = ?";
        return DBUtils.ExecuteUpdate(sql,new Object[]{money,name});
    }
}
